package com.mxfcode.app;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.io.IOException;

/**
 * @类名 YunYiCampusBBSApplication
 * @描述 TODO
 * @作者 mxf
 * @创建日期 2020/12/30 10:24
 **/
@EnableScheduling // 开启定时任务功能
@SpringBootApplication(scanBasePackages = "com")
@ComponentScan(value = {"com"})
//@MapperScan({"com.mxfcode.bbs_back.bbs_yhgl.dao"})
 @MapperScan({"${mybatis.mapperScanner.basePackage}"})
public class YunYiCampusBBSApplication {

    public static void main(String[] args) {
        int port = 8991;
        String portPrefix = "--server.port=";
        for (String arg : args) {
            if (arg.startsWith(portPrefix)) {
                port = Integer.parseInt(arg.substring(portPrefix.length()));
            }
        }
        SpringApplication.run(YunYiCampusBBSApplication.class,args);
//        try {
//            Runtime.getRuntime().exec("cmd /c start http://localhost:" + port + "/indexController/goIndexPage");
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
    }
}
